/* *
* * *
内容高度
* * *
* */
function dyniframesize() {
	var cliHeight = $(document).height();
	$('#iframepage').height(cliHeight);
}
/* *
* * *
导航切换
* * *
* */
function navCurrent() {
	$('.navbar-nav li').on('click',function(){
		$('.navbar-nav li').removeClass('on');
		$(this).addClass('on');
		var href = 'search_job.html';
		if($(this).index() == 1){//捞干货
			href = 'get_best.html';
		}else if($(this).index() == 2) {//我的
			href = 'my_page.html';
		}else if($(this).index() == 3) {//内容管理
			href = 'content_management.html';
		}else if($(this).index() == 4) {//系统管理
			href = 'systems_management.html';
		}
		$('#iframepage').attr('src',href);
	})
}
/* *
* * *
兼容IE palceholder
* * *
* */
var JPlaceHolder = {
    //检测
    _check : function(){
        return 'placeholder' in document.createElement('input');
    },
    //初始化
    init : function(){
        if(!this._check()){
            this.fix();
        }
    },
    //修复
    fix : function(){
        jQuery(':input[placeholder]').each(function(index, element) {
            var self = $(this), txt = self.attr('placeholder');
            self.wrap($('<div></div>').css({position:'relative', zoom:'1', border:'none', background:'none', padding:'none', margin:'none'}));
            var pos = self.position(), h = self.outerHeight(true), paddingleft = self.css('padding-left');
            var holder = $('<span></span>').text(txt).css({position:'absolute', left:pos.left, top:pos.top, height:h, lienHeight:h, paddingLeft:paddingleft, color:'#aaa'}).appendTo(self.parent());
            self.focusin(function(e) {
                holder.hide();
            }).focusout(function(e) {
                if(!self.val()){
                    holder.show();
                }
            });
            holder.click(function(e) {
                holder.hide();
                self.focus();
            });
        });
    }
};
/* *
* * *
更改原生checkbox样式
* * *
* */
var checkboxFun = function(target) {
                    $(target).on('click',function() {
                        if($(target).prev().hasClass('on')) {
                            $(target).prev().removeClass('on');
                        }else {
                            $(target).prev().addClass('on');
                        }
                    })
}

$(function(){
	dyniframesize();
	navCurrent();
	JPlaceHolder.init(); 
    //当浏览器窗口大小改变时，设置显示内容的高度  
    window.onresize=function(){  
         dyniframesize();  
    }  
});